namespace CYZHAPI.Common.tools
{
    public class EntityKeyToValue
    {
        public static object getProperties<T> (T t, string skey) {
            //sPropertiesKey = new ArrayList();
            //sPropertiesValue = new ArrayList();
            object oValue=null;
            if (t == null) {
                return oValue;
            }
            System.Reflection.PropertyInfo[] properties = t.GetType ().GetProperties (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
            if (properties.Length <= 0) {
                return oValue;
            }
            foreach (System.Reflection.PropertyInfo item in properties) {
                string name = item.Name;
                //object value = item.GetValue (t, null);
                if(skey.Equals(name)){
                    oValue =item.GetValue (t, null);
                    break;
                }
            }
            return oValue;
        }
    }
}